package com.atguigu;

import java.sql.*;

public class phoenixJdbc_API {
    public static void main(String[] args) throws SQLException {
        //1.获取链接
        Connection connection = DriverManager.getConnection("jdbc:phoenix:hadoop102,hadoop103,hadoop104");

        //2.语句预执行
        PreparedStatement pstm = connection.prepareStatement("select * from student");


        //3.执行语句获取结果
        ResultSet resultSet = pstm.executeQuery();

        while (resultSet.next()){
            System.out.println(resultSet.getString(1)+"-"+resultSet.getString(2)+"-"+resultSet.getString(3));
        }

        //4.关闭资源
        pstm.close();
        connection.close();

    }
}
